package skeleton;


public class Inverter extends DigitalGate {

    public Inverter () {
        Logger.Message("Inverter_konstruktor");
    }

    public void gateLogic () throws Exception {
        Logger.Enter("Inverter_gateLogic");

        //minden bemenetrol adatkeres
        for( int i=0; i<inputList.size(); i++ )
            inputList.get(i).getDigitalValue();

        //minden kimenetre adatkiadas
        for( int i=0; i<outputList.size(); i++ )
        {
            int answer = Prompter.Switch( new String[] {
                "Low",
                "High"
            });
            switch (answer) {
                    case 0:
                        outputList.get(i).setDigitalValue(Sign.Low);
                        break;
                    case 1:
                        outputList.get(i).setDigitalValue(Sign.High);
                        break;
            }

        }
        //kapulogika

        //valtozas ellenorzes
        boolean yesno = Prompter.YesNo("Tortent allapotvaltozas?");
            if (yesno)
            {
                setChanged();
                notifyObservers("StateChanged");
            }
        
        Logger.Leave("Inverter_gateLogic");
    }

}

